package com.caifu.enums;


import java.util.ArrayList;
import java.util.List;

/**
 * ClassName :LiveStatusEnum
 *
 * @author :  yb
 * @description ：
 * @date : 2020-11-21 11:22
 */
public enum LiveHomeStatusEnum {

    /**
     * 居住状况
     */
    DJ("8201", "独居")
    ,CL("8202", "纯老")
    ,YFMTZ("8203", "与父母同住")
    ,YZNTZQT("8204", "与子女同住");

    private String key;
    private String value;

    LiveHomeStatusEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public static Object[] getNameArr(){
        List<String> nameList = new ArrayList<>();
        for (LiveHomeStatusEnum c : LiveHomeStatusEnum.values()) {
            nameList.add(c.getValue());
        }
        return nameList.toArray();
    }


    public static String getName(String key) {
        for (LiveHomeStatusEnum c : LiveHomeStatusEnum.values()) {
            if (c.getKey().equals(key)) {
                return c.value;
            }
        }
        return "";
    }

    public static String getEnumKey(String name) {
        for (LiveHomeStatusEnum c : LiveHomeStatusEnum.values()) {
            if (c.getValue().equals(name)) {
                return c.key;
            }
        }
        return "";
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
